package com.cy.pj.sys.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.cy.pj.common.vo.JsonResult;
import com.cy.pj.common.vo.PageObject;
import com.cy.pj.sys.entity.SysLog;
import com.cy.pj.sys.service.SysLogService;

//@Controller
//@ResponseBody=@RestController
@RestController
@RequestMapping("/log/")
public class SysLogController {
	
	@Autowired
	private SysLogService ss;
	/**
	 * 分页查询请求处理方法(此方法由spring mvc框架通过反射技术)
	 * @param username 接受客户端请求中的username
	 * @param pageCurrent 接受客户端请求中的pageCurrent
	 * @return 封装了业务数据以及状态信息的一个对象
	 */
	@RequestMapping("doFindPageObjects")
//	@ResponseBody
	public JsonResult doFindPageObjects(String username,Integer pageCurrent) {
		PageObject<SysLog> findPageObjects = ss.findPageObjects(username, pageCurrent);
		return new JsonResult(findPageObjects);
	}
	@RequestMapping("doDeleteObjects")
	@ResponseBody
	public JsonResult doDeleteObjects(Integer... ids) {
		ss.deleteObjects(ids);
		return new JsonResult("delete ok");
	}
	
}











